import request from '@/utils/request'

// 发布交易单
export const releaseTradeOrder = (params) => {
	return request('POST', '/app/trade/exchange', params)
}

//	交易单列表 *卖出
export const getTradeList = (params) => {
	return request('GET', '/app/trade/exchange/list', params)
}

// 交易单详情 *卖出详情
export const getTradeOrderDetail = (tradeId) => {
	return request('GET', `/app/trade/exchange/${tradeId}`)
}

//	编辑交易单
export const editTradeOrder = (params) => {
	return request('PUT', '/app/trade/exchange', params)
}

// 用户订单列表 *买入
export const getUserOrderList = (params) => {
	return request('GET', `/app/trade/exchangeOrder/list`, params)
}

// 交易单订单列表
export const getTradeOrderList = (params) => {
	return request('GET', `/app/trade/exchangeOrder/listByTrade`, params)
}
// 交易单订单详情 *买入详情
export const exchangeOrderDetail = (tradeId) => {
	return request('GET', `/app/trade/exchangeOrder/${tradeId}`)
}

// 下单
export const OrderTrade = (params) => {
	return request('POST', '/app/trade/exchangeOrder', params)
}

// 【场外交易】乙方提交凭证
export const submitsCertificateB = (params) => {
	return request('PUT', '/app/trade/exchangeOrder/submitsCertificateB', params)
}

// 【场外交易】甲方确认
export const submitsCertificateA = (params) => {
	return request('PUT', '/app/trade/exchangeOrder/submitsCertificateA', params)
}

// 投诉
export const releaseOrderComplaint = (params) => {
	return request('POST', '/app/trade/exchangeOrder/complaint', params)
}

// 新增用户收款地址
export const releaseOderAddress = (params) => {
	return request('POST', '/app/trade/exchangeAddress', params)
}

// 获取用户收款地址
export const getOderAddress = (id) => {
	return request('GET', `/app/trade/exchangeAddress/${id}`)
}

// 获取系统货币
export const getCurrencyList = (params) => {
	return request('GET', `/app/currency/mini/list`, params)
}

// 删除交易单
export const exchangeCancel = (params) => {
	return request('POST', '/app/trade/exchange/cancel', params)
}

// 修改上下架(锁定)/解锁 
export const setShelfStatus = (params) => {
	return request('PUT', '/app/trade/exchange/setShelfStatus', params)
}

// 取消投诉
export const cancelComplaint = (params) => {
	return request('POST', '/app/trade/exchangeOrder/cancel/complaint', params)
}

// 取消订单
export const cancelOrder = (params) => {
	return request('POST', '/app/trade/exchangeOrder/cancel/order', params)
}

// 获取当前推荐国际汇率
export const getExchangeRate = (params) => {
	return request('GET', '/app/currency/getExchangeRate', params)
}